Skip to content

ConsoleProtocol: Update Signatures to match ConsoleExpectMixin #1712

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

SmithChart
Copy link
Member

Description

The ConsoleExpectMixin has learned some new tricks over time. But the ConsoleProtocol was not updated accordingly.

Every class implementing the ConsoleProtocol also uses the ConsoleExpectMixin - so it's safe to update the signatures according to the ConsoleExpectMixin.

For ConsoleProtocol.expect() I've used the type definition of the underlying pexpect library.

I have not updated the return types, since it's not clear to me what the ConsoleExpectMixin should return.

This helps users with IDEs to get better type hinting when using the ConsoleProtocol.

Checklist

  • Documentation for the feature
  • Tests for the feature
  • The arguments and description in doc/configuration.rst have been updated
  • Add a section on how to use the feature to doc/usage.rst
  • Add a section on how to use the feature to doc/development.rst
  • PR has been tested
  • Man pages have been regenerated

@SmithChart SmithChart force-pushed the consoleprotocol-signatures branch from c94eb6c to e4b9c94 Compare August 4, 2025 14:48
@@ -1,11 +1,14 @@
import abc
from typing import Optional

from pexpext import EOF, TIMEOUT
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be a typo breaking the CI?

Suggested change
from pexpext import EOF, TIMEOUT
from pexpect import EOF, TIMEOUT

The ConsoleExpectMixin has learned some new tricks over time.
But the ConsoleProtocol was not updated accordingly.

Every class implementing the ConsoleProtocol also uses the
ConsoleExpectMixin - so it's safe to update the signatures according to
the ConsoleExpectMixin.

For ConsoleProtocol.expect() I've used the type definition of the
underlying pexpect library.

I have not updated the return types, since it's not clear to me what the
ConsoleExpectMixin should return.

Signed-off-by: Chris Fiege <[email protected]>
@SmithChart SmithChart force-pushed the consoleprotocol-signatures branch from e4b9c94 to 30b1cc3 Compare August 6, 2025 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants